var app = angular.module('classApp',[]);
app.controller('classController',function($scope,$http){

    $scope.condition = {tid:$scope.tid,lname:$scope.lname,classdate:$scope.classdate};
    $http({
        method: 'POST',
        url: 'timetable/findClassByAdmin',
        params: $scope.condition,
        headers: { 'Content-Type': 'application/x-www-form-urlencoded'}
    }).then(function successCallback(response) {
        console.log(response);
        $scope.classes = response.data.classes;
        console.log($scope.classes);

    }, function errorCallback(response) {
        console.log("获取失败！");
    });
    /*获取数据操作*/
    $scope.findClass = function () {
        $scope.classdate = document.getElementById("classDate").value;

        $scope.condition = {tid:$scope.tid,lname:$scope.lname,classdate:$scope.classdate};
        $http({
            method: 'POST',
            url: 'timetable/findClassByAdmin',
            params: $scope.condition,
            headers: { 'Content-Type': 'application/x-www-form-urlencoded'}
        }).then(function successCallback(response) {
            console.log(response);
            $scope.classes = response.data.classes;
            console.log($scope.classes);

        }, function errorCallback(response) {
            console.log("获取失败！");
        });
    };


});